import paddlehub as hub
import cv2
import os.path

'''
merge and segment
'''
def hunman_seg(img):
    '''提取人像，返回人像图片的路径'''
    human_seg = hub.Module(name="deeplabv3p_xception65_humanseg")
    result = human_seg.segmentation(images=[img], visualization="true", output_dir="cache") # type: ignore
    return result[0]['save_path']